package com.lqr.wechat.activity;

import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import androidx.appcompat.widget.Toolbar;

import com.lqr.wechat.R;
import com.lqr.wechat.databinding.ActivityAllTagBinding;
import com.lqr.wechat.utils.UIUtils;


/**
 * @创建者 CSDN_LQR
 * @描述 所有标签界面
 */
public class AllTagActvitiy extends BaseActivity {
    private ActivityAllTagBinding binding ;
    @Override
    protected int layoutId() {
        return R.layout.activity_all_tag;
    }

    @Override
    public void initView() {
        binding = getBind() ;
        initToolbar();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        new MenuInflater(this).inflate(R.menu.menu_one_text, menu);
        menu.getItem(0).setTitle("新建");
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int itemId = item.getItemId();
        if (itemId == android.R.id.home) {
            finish();
        } else if (itemId == R.id.itemOne) {
            UIUtils.showToast("新建");
        }
        return super.onOptionsItemSelected(item);
    }

    private void initToolbar() {
        setSupportActionBar(binding.lyToolbar.toolbar);
        getSupportActionBar().setTitle("所有标签");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        binding.lyToolbar.toolbar.setNavigationIcon(R.mipmap.ic_back);
    }
}
